package cn.sccl.springmvc.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.sccl.springmvc.dao.ItemsMapper;
import cn.sccl.springmvc.pojo.Items;
import cn.sccl.springmvc.service.ItemService;

/**
 * @author 饶爽
 * @time 2019年10月20日 下午4:11:52
 * @version 1.0.0
 * 商品服务的实现类
*/
@Service
public class ItemServiceImpl implements ItemService {
    
    @Autowired
    private ItemsMapper itemsMapper;
    @Override
    public List<Items> selectItemsList() {
        return itemsMapper.selectByExampleWithBLOBs(null);
    }

    @Override
    public Items selectItemsById(Integer id) {
        return itemsMapper.selectByPrimaryKey(id);
    }

    @Override
    public void updateItemsById(Items items) {
        items.setCreatetime(new Date());
        itemsMapper.updateByPrimaryKeyWithBLOBs(items);
    }

}
